/**
 * 通过promise,延迟后面代码的执行,以方便异步代码执行
 * @param interval 延迟多久 单位ms
 * @returns {Promise<unknown>}
 */
function delay (interval=0){
    return new Promise(resolve => {
        let timer = setTimeout(_ =>{
            clearTimeout(timer)
            resolve()
        },interval)
    })
}
module.exports ={
    delay
}
